import 'package:flutter/material.dart';

import '../../../utils/util.dart';
import '../index.dart';

/// hello
class SingleSelectionCell extends GetView<SingleSelectionController> {
  const SingleSelectionCell({
    Key? key,
    required this.text,
    required this.index,
    this.isChoosed = false,
  }) : super(key: key);
  final String text;
  final int index;
  final bool isChoosed;
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () => controller.actionCell(index),
      child: Container(
        height: 40.r,
        color: Colors.white,
        alignment: Alignment.centerLeft,
        padding: EdgeInsets.symmetric(horizontal: 16.r),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              text,
              style: TextStyle(
                color: isChoosed ? ColorsUtil.theme : ColorsUtil.title,
                fontSize: 14.sp,
              ),
            ),
            isChoosed
                ? Icon(
                    Icons.check,
                    size: 18.r,
                    color: isChoosed ? ColorsUtil.theme : ColorsUtil.title,
                  )
                : const SizedBox(),
          ],
        ),
      ),
    );
  }
}
